package reactive;

import io.netty.util.concurrent.DefaultThreadFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Scheduler;
import reactor.core.scheduler.Schedulers;

public class T3 {
    private static Logger log = LoggerFactory.getLogger(T3.class);
    public static void main(String[] args) {
        Scheduler scheduler = Schedulers.newSingle(new DefaultThreadFactory("transaction"));
        Mono mono=   Mono.create(c -> c.success("XXXXX")).publishOn(scheduler).doFinally(t -> scheduler.dispose());
        mono.subscribe(c-> log.info(c.toString()));
    }
}
